1. Field of the Invention
The present invention relates to a function of a microcontroller, and in particular, to an address re-designate circuit for a microcontroller which is capable of re-designating an address of a built-in peripheral circuit.
2. Description of the Prior Art
As shown in FIG. 1, a conventional microcontroller includes a memory device 102 for storing a program or data, an address decoder 103 for decoding an address and allocating it to peripheral circuits(104-1.about.104-N), and a central processing unit(CPU) 101 for executing the program stored in the memory 102 and outputting control signals(RD)(WE) to the peripheral circuits(104-1.about.104-N). These elements are interconnected with a data bus and an address bus.
The operation of a conventional address re-designate circuit will now be described in detail.
When the microcontroller is equipped in an apparatus to execute an operation, the CPU makes a chip enable signal(CE) active and the memory 102 is enabled to thereafter execute a program contained in the memory 102.
Here, the CPU 101 outputs an address for setting the peripheral circuits 104-1.about.104-N.
Then, when the address decoder 103 decodes the address (ADDR) to allocate to the peripheral circuit 104-1.about.104-N, the CPU outputs a control signal(RD,WE) so that a corresponding peripheral circuit receives data and executes a corresponding function.
The microcontroller which carries out the above-described operation can be connected to an emulator, as shown in FIG. 2.
That is, when a user inputs a key to carry out a program, a controller 111 executes the program stored in a first memory 112 and drives a microcontroller 114.
Here, the microcontroller 114 executes the program stored in the memory device 102 to generate an address, and the address decoder 103 receiving the address sequentially sets the peripheral circuits 104-1.about.104-N.
Then, the CPU outputs the control signals(RD,WE) to operate the corresponding circuit among the peripheral circuits 104-1.about.104-N, and as a result, the corresponding circuit receives data from the data bus to perform a corresponding function. Here, the data resulting from the function execution is stored in a second memory 113.
Afterward, when the user inputs a key for checking an executing state of a function while carrying out a program, the controller 111 stops the operation of the microcontroller 114.
Here, when the user inputs a key for checking the execution of an arbitrary function, the controller 111 reads out a corresponding data among the data stored in the second memory 113 to output the read data to a monitor(not illustrated).
Then, the user checks the data on the screen of the monitor(not illustrated) and judges an executing condition of the corresponding function.
However, according to the conventional art, since the address of a peripheral circuit built in the microcontroller is fixedly allocated, the user disadvantageously cannot re-designate the address arbitrarily.
That is, as shown in FIG. 2, when a microcontroller is equipped in the emulator for programming, an EVA-CHIP must be provided for supporting a new microcontroller when a program for a microcontroller having a previously unknown combination of peripheral circuits is being developed.
Therefore, to the user's disadvantage, it takes much time and high cost to fabricate the EVA-CHIP and the development of a targeted microcontroller and preparation of the software for using the microcontroller must be performed at the same time.